Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weekly upstream merge #6

Merged
merged 15 commits into from
Sep 13, 2023
Merged

Weekly upstream merge #6

merged 15 commits into from
Sep 13, 2023

Conversation

frank-emrich
Copy link

The only major change is dealing with the redesign of how wasmtime handles CLI arguments, performed by this PR: bytecodealliance#6925

fitzgen and others added 15 commits September 9, 2023 17:26
This commit adds the component equivalents of the existing core Wasm call
micro-benchmarks. This also adds a sprinkling of `#[inline]` to some functions
that I noticed when glancing at some profiles.

The two most important numbers:

```
sync/no-hook/component - host-to-wasm - typed - nop
                        time:   [75.849 ns 76.476 ns 77.247 ns]

sync/no-hook/component - wasm-to-host - typed - nop
                        time:   [33.614 ns 33.872 ns 34.170 ns]
```

The full benchmark results are in here:

<details>

```
$ cargo bench --features component-model --bench call 'component'
    Finished bench [optimized] target(s) in 0.19s
     Running benches/call.rs (target/release/deps/call-4d8d1585dd2825a2)
sync/no-hook/component - host-to-wasm - typed - nop
                        time:   [75.849 ns 76.476 ns 77.247 ns]
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) high mild
  4 (4.00%) high severe
sync/no-hook/component - host-to-wasm - untyped - nop
                        time:   [108.29 ns 109.66 ns 111.51 ns]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe
sync/no-hook/component - host-to-wasm - typed - nop-params-and-results
                        time:   [79.968 ns 80.756 ns 81.728 ns]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high severe
sync/no-hook/component - host-to-wasm - untyped - nop-params-and-results
                        time:   [210.27 ns 211.72 ns 213.34 ns]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe

sync/hook-sync/component - host-to-wasm - typed - nop
                        time:   [76.840 ns 77.295 ns 77.770 ns]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
sync/hook-sync/component - host-to-wasm - untyped - nop
                        time:   [109.63 ns 110.42 ns 111.26 ns]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe
sync/hook-sync/component - host-to-wasm - typed - nop-params-and-results
                        time:   [81.324 ns 82.344 ns 83.663 ns]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
sync/hook-sync/component - host-to-wasm - untyped - nop-params-and-results
                        time:   [211.84 ns 215.06 ns 219.22 ns]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe

async/no-hook/component - host-to-wasm - typed - nop
                        time:   [23.759 µs 23.969 µs 24.221 µs]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) high mild
  10 (10.00%) high severe
async/no-hook/component - host-to-wasm - untyped - nop
                        time:   [23.941 µs 24.093 µs 24.254 µs]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
async/no-hook/component - host-to-wasm - typed - nop-params-and-results
                        time:   [24.286 µs 24.459 µs 24.629 µs]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
async/no-hook/component - host-to-wasm - untyped - nop-params-and-results
                        time:   [24.258 µs 24.390 µs 24.528 µs]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

async/hook-sync/component - host-to-wasm - typed - nop
                        time:   [24.055 µs 24.224 µs 24.408 µs]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe
async/hook-sync/component - host-to-wasm - untyped - nop
                        time:   [24.217 µs 24.364 µs 24.517 µs]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe
async/hook-sync/component - host-to-wasm - typed - nop-params-and-results
                        time:   [24.207 µs 24.331 µs 24.463 µs]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
async/hook-sync/component - host-to-wasm - untyped - nop-params-and-results
                        time:   [24.607 µs 24.767 µs 24.936 µs]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

async-pool/no-hook/component - host-to-wasm - typed - nop
                        time:   [456.89 ns 459.65 ns 462.68 ns]
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe
async-pool/no-hook/component - host-to-wasm - untyped - nop
                        time:   [490.07 ns 492.87 ns 495.88 ns]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
async-pool/no-hook/component - host-to-wasm - typed - nop-params-and-results
                        time:   [471.68 ns 475.01 ns 478.59 ns]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
async-pool/no-hook/component - host-to-wasm - untyped - nop-params-and-results
                        time:   [597.02 ns 600.61 ns 604.53 ns]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

async-pool/hook-sync/component - host-to-wasm - typed - nop
                        time:   [458.06 ns 460.82 ns 463.77 ns]
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high severe
async-pool/hook-sync/component - host-to-wasm - untyped - nop
                        time:   [494.20 ns 497.65 ns 501.48 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high severe
async-pool/hook-sync/component - host-to-wasm - typed - nop-params-and-results
                        time:   [472.40 ns 476.08 ns 480.10 ns]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe
async-pool/hook-sync/component - host-to-wasm - untyped - nop-params-and-results
                        time:   [598.55 ns 603.79 ns 610.18 ns]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

sync/no-hook/component - wasm-to-host - typed - nop
                        time:   [33.614 ns 33.872 ns 34.170 ns]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) high mild
  8 (8.00%) high severe
sync/no-hook/component - wasm-to-host - typed - nop-params-and-results
                        time:   [37.416 ns 37.700 ns 38.002 ns]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
sync/no-hook/component - wasm-to-host - untyped - nop
                        time:   [58.126 ns 58.478 ns 58.846 ns]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
sync/no-hook/component - wasm-to-host - untyped - nop-params-and-results
                        time:   [170.14 ns 171.33 ns 172.68 ns]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

sync/hook-sync/component - wasm-to-host - typed - nop
                        time:   [33.336 ns 33.556 ns 33.796 ns]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
sync/hook-sync/component - wasm-to-host - typed - nop-params-and-results
                        time:   [37.399 ns 37.654 ns 37.904 ns]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
sync/hook-sync/component - wasm-to-host - untyped - nop
                        time:   [58.438 ns 58.924 ns 59.485 ns]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
sync/hook-sync/component - wasm-to-host - untyped - nop-params-and-results
                        time:   [169.36 ns 170.44 ns 171.60 ns]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe

async/no-hook/component - wasm-to-host - typed - nop
                        time:   [33.882 ns 34.198 ns 34.573 ns]
Found 11 outliers among 100 measurements (11.00%)
  6 (6.00%) high mild
  5 (5.00%) high severe
async/no-hook/component - wasm-to-host - typed - nop-params-and-results
                        time:   [37.407 ns 37.820 ns 38.371 ns]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
async/no-hook/component - wasm-to-host - untyped - nop
                        time:   [58.400 ns 58.937 ns 59.537 ns]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
async/no-hook/component - wasm-to-host - untyped - nop-params-and-results
                        time:   [170.15 ns 171.72 ns 173.52 ns]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
async/no-hook/component - wasm-to-host - async-typed - nop
                        time:   [48.383 ns 48.801 ns 49.317 ns]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
async/no-hook/component - wasm-to-host - async-typed - nop-params-and-results
                        time:   [59.723 ns 60.158 ns 60.657 ns]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

async/hook-sync/component - wasm-to-host - typed - nop
                        time:   [33.537 ns 34.056 ns 34.742 ns]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
async/hook-sync/component - wasm-to-host - typed - nop-params-and-results
                        time:   [37.390 ns 37.888 ns 38.562 ns]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
async/hook-sync/component - wasm-to-host - untyped - nop
                        time:   [58.506 ns 58.906 ns 59.361 ns]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
async/hook-sync/component - wasm-to-host - untyped - nop-params-and-results
                        time:   [170.70 ns 172.62 ns 174.80 ns]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
async/hook-sync/component - wasm-to-host - async-typed - nop
                        time:   [48.308 ns 48.764 ns 49.267 ns]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
async/hook-sync/component - wasm-to-host - async-typed - nop-params-and-results
                        time:   [57.503 ns 57.887 ns 58.307 ns]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe

async-pool/no-hook/component - wasm-to-host - typed - nop
                        time:   [33.473 ns 33.792 ns 34.142 ns]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
async-pool/no-hook/component - wasm-to-host - typed - nop-params-and-results
                        time:   [37.523 ns 38.040 ns 38.638 ns]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe
async-pool/no-hook/component - wasm-to-host - untyped - nop
                        time:   [57.989 ns 58.350 ns 58.737 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high severe
async-pool/no-hook/component - wasm-to-host - untyped - nop-params-and-results
                        time:   [169.55 ns 170.93 ns 172.48 ns]
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe
async-pool/no-hook/component - wasm-to-host - async-typed - nop
                        time:   [48.323 ns 48.700 ns 49.144 ns]
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) high mild
  4 (4.00%) high severe
async-pool/no-hook/component - wasm-to-host - async-typed - nop-params-and-results
                        time:   [57.521 ns 58.090 ns 58.739 ns]
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe

async-pool/hook-sync/component - wasm-to-host - typed - nop
                        time:   [33.379 ns 33.602 ns 33.838 ns]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
async-pool/hook-sync/component - wasm-to-host - typed - nop-params-and-results
                        time:   [37.361 ns 37.608 ns 37.857 ns]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
async-pool/hook-sync/component - wasm-to-host - untyped - nop
                        time:   [58.523 ns 58.848 ns 59.180 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high severe
async-pool/hook-sync/component - wasm-to-host - untyped - nop-params-and-results
                        time:   [170.59 ns 171.57 ns 172.63 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high severe
async-pool/hook-sync/component - wasm-to-host - async-typed - nop
                        time:   [48.265 ns 48.520 ns 48.794 ns]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high severe
async-pool/hook-sync/component - wasm-to-host - async-typed - nop-params-and-results
                        time:   [57.619 ns 57.918 ns 58.234 ns]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe
```

</details>
* riscv64: Delete ECall instruction

* riscv64: Delete `fence.i` instruction

* riscv64: Delete `emit_fneg`
… interpreter (bytecodealliance#6985)

* cranelift: Implement `vall_true` for floats in the interpreter

* cranelift: Implement `vany_true` for floats in the interpreter

* cranelift: Implement `vhigh_bits` for floats in the interpreter

* cranelift: Forbid vector return types for `vhigh_bits`

This instruction doesen't really make sense with a vector return type.
The description also states that it returns a scalar integer so I suspect
it wasn't intended to allow vector integers.

* fuzzgen: Enable `v{all,any}_true` and `vhigh_bits`
)

* winch: Support f32.abs and f64.abs on x64

Co-authored-by: Nick Fitzgerald <[email protected]>

* Add an implementation of f32.neg and f64.neg

* Enable spec tests for winch with f{32,64}.{neg,abs}

* Enable differential fuzzing for f{32,64}.{neg,abs} for winch

* Comments from code review

---------

Co-authored-by: Nick Fitzgerald <[email protected]>
* Improve lowering of store_imm on x64

Adds a new x64 rule for directly lowering stores of immediates with a MOV instruction.

* Ensure that the MovImmM operand fits in an i32 and add tests.

* Update winch to handle MovImmM change
…bytecodealliance#6988)

* riscv64: Use `MachLabel` for Jal

* riscv64: Use `Inst::gen_jump` for jumps

This is mostly a personal preference. It emits the exact same code.

* riscv64: Use VecMachLabel on BrTable

* riscv64: Remove `BranchTarget::Offset` arm

Replaces it with `Fallthrough` which works the same way with
a fixed offset of 0.

* riscv64: Rename `BranchTarget`

It is now only used for `CondBr`

* riscv64: Panic on fallthrough taken target in condbr
* x64: Remove recursion in `to_amode` helper

This commit removes the recursion present in the x64 backend's
`to_amode` and `to_amode_add` helpers. The recursion is currently
unbounded and controlled by user input meaning it's not too hard to
craft user input which triggers stack overflow in the host. By removing
recursion there's no need to worry about this since the stack depth will
never be hit.

The main concern with removing recursion is that code quality may not be
quite as good any more. The purpose of the recursion here is to "hunt
for constants" and update the immediate `Offset32`, and now without
recursion only at most one constant is found and folded instead of an
arbitrary number of constants as before. This should continue to produce
the same code as before so long as optimizations are enabled, but
without optimizations this will produce worse code than before.

Note with a hypothetical mid-end optimization that does this constant
folding for us the rules here could be further simplified to purely
consider the shape of the input `Value` to amode computation without
considering constants at all.

* aarch64: Remove recursion from amode lowering rules

Same as the prior commit for x64, but for aarch64 instead. Unlikely to
be reachable from wasm due to this only being a part of addressing modes
which are more strictly controlled in wasm (e.g. wasm addresses are
always a zero-extended value added to a base, so it's not possible to
have a long chain of constants at the top level in clif)
* Finish release notes for 13.0.0

Filling out everything that happened since bytecodealliance#6929

* Inline MSRV policy

* More notes
…nce#6994)

* Remove tutorial/wasm-writing documentation

This commit removes the tutorial and "Writing WebAssembly" documentation
sections from Wasmtime's documentation. These sections are quite dated
at this point (they still recommend `cargo wasi`!) and haven't been
updated much since their inception, especially in the arena of
components. Today it seems best to leave this sort of documentation to
[other resources] which are more tailored towards documentation of
writing wasm.

[other resources]: https://component-model.bytecodealliance.org/

* Remove markdown example from docs

Like the previous commit this is quite dated and recommends
effectively-deprecated tooling and doesn't take into account components.

* Update our intro docs a bit

* Link security blog post from docs

* Fold docs of wasm proposals into tier docs

This was already a bit duplicated so consolidate into one location.
Additionally add some proposals that weren't previously documented and
move some around based on their implementation status.

* Document unsupported features

In an effort to head off questions about platform support I figure it
might be a good idea to start documenting what's not supported at this
time. This is intended to mirror the current state, not future, of
Wasmtime. In other words this should answer the question of "Does
Wasmtime support X?" as opposed to "Does Wasmtime want to support X?"
since we want to eventually support all of these features in the limit.

* Fold WASI docs into tier docs

Similar to the previous commit but for WASI proposals.
Looks like this wasn't built on CI since it wasn't tested. Flag it as
testable which should build it on CI which should catch future errors
like this.
…odealliance#6993)

* [wasmtime-wasi] fix logic error in `monotonic-clock/subscribe`

When calculating the number of nanoseconds to wait, we should subtract the
current time from the deadline, not vice-versa.  This was causing guests to
sleep indefinitely due to integer underflow.

Signed-off-by: Joel Dice <[email protected]>

* add `sleep` test to `wasi-tests`

Note that this is annotated `should_panic` when testing preview1 scenarios,
since those won't have preview2 imports.

Signed-off-by: Joel Dice <[email protected]>

---------

Signed-off-by: Joel Dice <[email protected]>
* Redesign Wasmtime's CLI

This commit follows through on discussion from bytecodealliance#6741 to redesign the
flags that the `wasmtime` binary accepts on the CLI. Almost all flags
have been renamed/moved and will require callers to update. The main
motivation here is to cut down on the forest of options in `wasmtime -h`
which are difficult to mentally group together and understand.

The main change implemented here is to move options behind "option
groups" which are intended to be abbreviated with a single letter:

* `-O foo` - an optimization or performance-tuning related option
* `-C foo` - a codegen option affecting the compilation process.
* `-D foo` - a debug-related option
* `-W foo` - a wasm-related option, for example changing wasm semantics
* `-S foo` - a WASI-related option, configuring various proposals for example

Each option group can be explored by passing `help`, for example `-O
help`. This will print all options within the group along with their
help message. Additionally `-O help-long` can be passed to print the
full comment for each option if desired.

Option groups can be specified multiple times on the command line, for
example `-Wrelaxed-simd -Wthreads`. They can also be combined together
with commas as `-Wrelaxed-simd,threads`. Configuration works as a "last
option wins" so `-Ccache,cache=n` would end up with a compilation
cache disabled.

Boolean options can be specified as `-C foo` to enable `foo`, or they
can be specified with `-Cfoo=$val` with any of `y`, `n`, `yes`, `no`,
`true`, or `false`. All other options require a `=foo` value to be
passed and the parsing depends on the type.

This commit additionally applies a few small refactorings to the CLI as
well. For example the help text no longer prints information about wasm
features after printing the option help. This is still available via
`-Whelp` as all wasm features have moved from `--wasm-features` to `-W`.
Additionally flags are no longer conditionally compiled in, but instead
all flags are always supported. A runtime error is returned if support
for a flag is not compiled in. Additionally the "experimental" name of
WASI proposals has been dropped in favor of just the name of the
proposal, for example `--wasi nn` instead of `--wasi-modules
experimental-wasi-nn`. This is intended to mirror how wasm proposals
don't have "experimental" in the name and an opt-in is required
regardless.

A full listing of flags and how they have changed is:

| old cli flag                                  | new cli flag                                    |
|-----------------------------------------------|-------------------------------------------------|
| `-O, --optimize`                              | removed                                         |
| `--opt-level <LEVEL>`                         | `-O opt-level=N`                                |
| `--dynamic-memory-guard-size <SIZE>`          | `-O dynamic-memory-guard-size=...`              |
| `--static-memory-forced`                      | `-O static-memory-forced`                       |
| `--static-memory-guard-size <SIZE>`           | `-O static-memory-guard-size=N`                 |
| `--static-memory-maximum-size <MAXIMUM>`      | `-O static-memory-maximum-size=N`               |
| `--dynamic-memory-reserved-for-growth <SIZE>` | `-O dynamic-memory-reserved-for-growth=...`     |
| `--pooling-allocator`                         | `-O pooling-allocator`                          |
| `--disable-memory-init-cow`                   | `-O memory-init-cow=no`                         |
| `--compiler <COMPILER>`                       | `-C compiler=..`                                |
| `--enable-cranelift-debug-verifier`           | `-C cranelift-debug-verifier`                   |
| `--cranelift-enable <SETTING>`                | `-C cranelift-NAME`                             |
| `--cranelift-set <NAME=VALUE>`                | `-C cranelift-NAME=VALUE`                       |
| `--config <CONFIG_PATH>`                      | `-C cache-config=..`                            |
| `--disable-cache`                             | `-C cache=no`                                   |
| `--disable-parallel-compilation`              | `-C parallel-compilation=no`                    |
| `-g`                                          | `-D debug-info`                                 |
| `--disable-address-map`                       | `-D address-map=no`                             |
| `--disable-logging`                           | `-D logging=no`                                 |
| `--log-to-files`                              | `-D log-to-files`                               |
| `--coredump-on-trap <PATH>`                   | `-D coredump=..`                                |
| `--wasm-features all`                         | `-W all-proposals`                              |
| `--wasm-features -all`                        | `-W all-proposals=n`                            |
| `--wasm-features bulk-memory`                 | `-W bulk-memory`                                |
| `--wasm-features multi-memory`                | `-W multi-memory`                               |
| `--wasm-features multi-value`                 | `-W multi-value`                                |
| `--wasm-features reference-types`             | `-W reference-types`                            |
| `--wasm-features simd`                        | `-W simd`                                       |
| `--wasm-features tail-call`                   | `-W tail-call`                                  |
| `--wasm-features threads`                     | `-W threads`                                    |
| `--wasm-features memory64`                    | `-W memory64`                                   |
| `--wasm-features copmonent-model`             | `-W component-model`                            |
| `--wasm-features function-references`         | `-W function-references`                        |
| `--relaxed-simd-deterministic`                | `-W relaxed-simd-deterministic`                 |
| `--enable-cranelift-nan-canonicalization`     | `-W nan-canonicalization`                       |
| `--fuel <N>`                                  | `-W fuel=N`                                     |
| `--epoch-interruption`                        | `-W epoch-interruption`                         |
| `--allow-unknown-exports`                     | `-W unknown-exports-allow`                      |
| `--trap-unknown-imports`                      | `-W unknown-imports-trap`                       |
| `--default-values-unknown-imports`            | `-W unknown-imports-default`                    |
| `--max-instances <MAX_INSTANCES>`             | `-W max-instances=N`                            |
| `--max-memories <MAX_MEMORIES>`               | `-W max-memories=N`                             |
| `--max-memory-size <BYTES>`                   | `-W max-memory-size=N`                          |
| `--max-table-elements <MAX_TABLE_ELEMENTS>`   | `-W max-table-elements=N`                       |
| `--max-tables <MAX_TABLES>`                   | `-W max-tables=N`                               |
| `--max-wasm-stack <MAX_WASM_STACK>`           | `-W max-wasm-stack=N`                           |
| `--trap-on-grow-failure`                      | `-W trap-on-grow-failure`                       |
| `--wasm-timeout <TIME>`                       | `-W timeout=N`                                  |
| `--wmemcheck`                                 | `-W wmemcheck`                                  |
| `--wasi-modules default`                      | removed                                         |
| `--wasi-modules -default`                     | removed                                         |
| `--wasi-modules wasi-common`                  | `-S common`                                     |
| `--wasi-modules -wasi-common`                 | `-S common=n`                                   |
| `--wasi-modules experimental-wasi-nn`         | `-S nn`                                         |
| `--wasi-modules experimental-wasi-threads`    | `-S threads`                                    |
| `--wasi-modules experimental-wasi-http`       | `-S http`                                       |
| `--listenfd`                                  | `-S listenfd`                                   |
| `--tcplisten <SOCKET ADDRESS>`                | `-S tcplisten=...`                              |
| `--wasi-nn-graph <FORMAT::HOST>`              | `-S nn-graph=FORMAT::HOST`                      |
| `--preview2`                                  | `-S preview2`                                   |
| `--dir <DIRECTORY>`                           | `--dir ...`                                     |
| `--mapdir <GUEST_DIR::HOST_DIR>`              | `--dir a::b`                                    |

* Be more descriptive with help text

* Document `=val` is optional for `-Ccranelift-xxx`

* Fix compile after rebase

* Fix rebase of `--inherit-network`

* Fix wasi-http test

* Fix compile without pooling allocator support

* Update some flags in docs

* Fix bench-api build

* Update flags for gdb/lldb tests

* Fixup optimization flags

prtest:full
* riscv64: Add compressed extension instructions

The C extension has been split a little bit since its introduction
let's support the finer grained instructions.

This also disables compressed instruction support by default.

* ci: Enable zcb extension on RISC-V QEMU

* riscv64: Enable RVC mode in capstone

Conditionally enable compressed instruction disassembly.

* riscv64: Prepare to emit compressed instructions

This commit reorganizes our emit function to first
try a special case for compressed instruction, before
falling back to uncompressed instructions.

Currently the compressed case does nothing.

* riscv64: Move emit register allocation to separate function

We can only emit compressed instructions if they have a
specific physical register. For example `c.mv` does not support
using the `x0` register.

Thus, move the allocation function that converts from
virtual registers to physical registers into a separate step
before trying to emit the instruction.

This allows us to know the real register when emitting
compressed instructions.

* riscv64: Emit BrTable as uncompressed

`br_table` computes physical offsets from a certain instruction.
Thus we need to force these instructions to be uncompressed
in order to not jump into the wrong target.

* riscv64: Mark DWARF CIE code alignment as 2 bytes

* riscv64: Make minimum function alignment 2 bytes

* riscv64: Emit `c.add`

* riscv64: Add `c.mv`

* riscv64: Add c runtests

* Revert "ci: Enable zcb extension on RISC-V QEMU"

This reverts commit 212dec4.

It looks like the version of QEMU that CI uses does not yet
support Zcb.
This change is a small refactoring to some of the MacroAssembler functions to
use `Reg` instead of `RegImm` where appropriate (e.g. when the operand is a
destination).

@elliottt pointed this out while working on bytecodealliance#6982

This change also changes the signature of `float_abs` and `float_neg`, which can
be simplified to take a single register.
@dhil dhil merged commit d20db0c into wasmfx:main Sep 13, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants